package com.imy.luascript.retrofit;

/**
 * 在此写用途
 *
 * @author: Imy
 * @date: 2017-06-15
 */
public class ApiException extends RuntimeException {
  /**
   * 服务器异常
   */
  public static final int CODE_SERVER_ERROR = 1001;
  /**
   * 未知异常
   */
  public static final int CODE_UNKNOWN_ERROR = 1002;
  /***
   * 预约要需要验证
   */
  public static final int CODE_APPOINTMENT_VERIFY = 7003;
  /**
   * 预约验证码失效
   */
  public static final int CODE_APPOINTMENT_CODE_INVALID = 7002;
  /**
   * 预约验证码失败
   */
  public static final int CODE_APPOINTMENT_VERIFY_FAILURE = 7001;
  /***
   *预约验证码太频繁
   */
  public static final int CODE_EXCEED_MES_NUM = 7004;


  private int code;
  private String message;
  private String exceptionCause;//原因
  //以下是为了解析出问题，给服务端传数据进行排查
  private String response;

  public ApiException(int code, String message) {
    this.code = code;
    this.message = message;
  }

  public int getCode() {
    return code;
  }

  @Override
  public String getMessage() {
    return message;
  }

  public void setMessage(String message) {
    this.message = message;
  }

  public String getResponse() {
    return response;
  }

  public void setResponse(String response) {
    this.response = response;
  }

  public String getExceptionCause() {
    return exceptionCause;
  }

  public void setExceptionCause(String exceptionCause) {
    this.exceptionCause = exceptionCause;
  }
}
